#include "idatabase.h"

IDatabase::IDatabase(QObject *parent) :
	QObject(parent),
	m_port(-1),
	m_pCore(NULL)
{
}

IDatabase::~IDatabase(){

}

void IDatabase::init(Core *singleton){
	m_pCore = singleton;
	emit pluginInitiated();
}

void IDatabase::setDatabaseName(const QString &dbName){
	m_databaseName = dbName;
}

QString IDatabase::getDatabaseName() const {
	return m_databaseName;
}

void IDatabase::setHostName(const QString &host){
	m_hostName = host;
}

QString IDatabase::getHostName() const {
	return m_hostName;
}

void IDatabase::setUserName(const QString &userName){
	m_userName = userName;
}

QString IDatabase::getUserName() const {
	return m_userName;
}

void IDatabase::setPassword(const QString &password){
	m_password = password;
}

QString IDatabase::getPassword() const {
	return m_password;
}

void IDatabase::setPort(const int &port){
	m_port = port;
}

int IDatabase::getPort() const {
	return m_port;
}

void IDatabase::setConnection( const QString &host, const QString &userName,
							   const QString &password, const int &port )
{
	m_hostName = host;
	m_userName = userName;
	m_password = password;
	if( port > 0 )
		m_port = port;
}
